package com.eric.demo.validate;
/**
 * 引入jar
 *
 * <dependency>
 *  <groupId>javax.validation</groupId>
 *  <artifactId>validation-api</artifactId>
 *  <version>2.0.1.FINAL</version>
 * </dependency>
 *
 * <dependency>
 *  <groupId>org.hibernate</groupId>
 * 	<artifactId>hibernate-validator</artifactId>
 * 	<version>6.0.9.Final</version>
 * </dependency>
 *
 * <dependency>
 *  <groupId>javax.el</groupId>
 *  <artifactId>javax.el-api</artifactId>
 *  <version>2.2.4</version>
 * </dependency>
 *
 * <dependency>
 *  <groupId>org.glassfish.web</groupId>
 *  <artifactId>javax.el</artifactId>
 *  <version>2.2.6</version>
 * </dependency>
 *
 * <dependency>
 *  <groupId>org.apache.tomcat</groupId>
 *  <artifactId>tomcat-el-api</artifactId>
 *  <version>8.5.33</version>
 * </dependency>
 */

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.util.Date;

/**
 * @author ZhangGuangyin on 2018/8/20
 */
@Data
public class User {

    @NotBlank(message = "name为空！")
    public String name;

    @Min(value = 18, message = "必须大于18")
    private int age;

    @Past(message = "过去时间")
    @NotNull
    private Date birthday;
}
